package com.atguigu.springcloud.alibaba.controller;

import com.atguigu.springcloud.alibaba.entity.CommonResult;
import com.atguigu.springcloud.alibaba.entity.Order;
import com.atguigu.springcloud.alibaba.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: cloud2020
 * @description: TODO
 * @author: YuWenYi
 * @create: 2021-04-19 20:49
 **/
@RestController
public class OrderController {

    @Autowired
    private OrderService orderService;
    @GetMapping("/order/create")
    public CommonResult create(Order order)
    {
        orderService.saveOrder(order);
        return new CommonResult(200,"订单创建成功",order);
    }

}
